<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>合同维护记录查看</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>  
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">		
    <section class="content-header">
        <h1>合同维护记录查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">合同管理</a></li>
            <li class="active"><a href="#">合同查看</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="form-inline">             
                 <div class="form-group form-group-xs">
                        <label for="sysNoticeDateTime">更新时间：</label>
                        <input class="form-control" type="text" name="startPoint" id="startPoint" placeholder="开始时间" data-provide="datepicker" data-date-fmt="yyyy-MM-dd  HH:mm:ss"/>
                        <label>-</label>
                        <input class="form-control" type="text" name="endPoint" id="endPoint" placeholder="结束时间" data-provide="datepicker" data-date-fmt="yyyy-MM-dd  HH:mm:ss" />
                    </div>
                    <button type="button" class="btn btn-success btn-sm" onclick="search();">查&nbsp;询</button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <div class=" box box-warning bottongroup">
             <a href="toBidContractList.html" class="btn btn-default btn-sm">返&nbsp;回</a>
        </div>
    </section>
     <%@ include file="/WEB-INF/component/commonJS.jsp" %>  
    <script type="text/javascript">
    	function search(page) {
    		var projectId = $.trim($("#projectId").val());
    		var contractTitle = $.trim($("#contractTitle").val());
    		var status = $.trim($("#status").val());
    		var auditStatus = $.trim($("#auditStatus").val())
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{"projId":projectId, "contractTitle":contractTitle ,"status":status, "auditStatus":auditStatus},
    	        page : (page || 1)
    	    }).trigger("reloadGrid"); //重新载入  
    	}
    
        $(function (){
            $("#gridlist").jqGrid({
                url: "getContactLogList.html?contractId=${contractId }",
                mtype: "post",
                datatype: "json",
                autowidth: true,
                shrinkToFit: false,
                height: 270,
                colNames: [
       				'操作',
                    '所属项目',
                    '合同id',
                    '合同编码',
                    '合同标题',
                    '合同甲方',
                    '合同乙方',
                    '签订日期',
                    '审核状态',
                    '审核时间',
                    '更新时间',
                    '更新人',
                    '状态'
                ],
                colModel: [
					{ name: 'operate', width: 60, align:"center", sortable: false,
						formatter : function(val, opts, rowdata) {
							var str=""
					    	str += "<a href='toContractLogDetail.html?contractId=" + rowdata.contractId + "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='详情'></a>";
					    	return str;
					}},
                    { name: 'projName', width: 160, align:"center", sortable: false},
                    { name: 'contractId', hidden:true, width: 100, align:"center", sortable: false},
                    { name: 'contractCode',hidden:true, width: 120, align:"center", sortable: false},
                    { name: 'contractTitle', width: 160, align:"center", sortable: false },
                    { name: 'contractPartyA', width: 160, align:"center", sortable: false },
                    { name: 'contractPartyB', width: 160, align:"center", sortable: false },
                    { name: 'signupDatetime', width: 140, align:"center", sortable: false },
                    { name: 'auditStatus', width: 60, align: 'center', sortable: false,
                    	formatter : function(val, opts, rowdata) {
                    		var strSta = "";
                    		if(rowdata.auditStatus == 0){
                    			strSta += "新建";
                    		}else if(rowdata.auditStatus == 1){
                    			strSta += "提交";
                    		}else if(rowdata.auditStatus == 2){
                    			strSta += "审核通过";
                    		}else if(rowdata.auditStauts == 3){
                    			strSta += "审核不通过"
                    		}
                    		return strSta;
                    	}
                    },
                    { name: 'auditDatatime', width: 160, align:"center", sortable: false },
                    { name: 'updDatetime', width: 160, align:"center", sortable: false },
                    { name: 'updUser', width: 140, align:"center", sortable: false },
                    { name: 'status', width: 40, align: 'center', sortable: false,
                    	formatter : function(val, opts, rowdata) {
                    		var strSta = "";
                    		if(rowdata.status == 1){
                    			strSta += "启用";
                    		}else{
                    			strSta += "停用";
                    		}
                    		return strSta;
                    	}
                    }
                    
                ],
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: true, 
                viewrecords: true,
                caption: "合同列表",
                jsonReader: {
                    id: "contractModelId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
	})
    </script>
</body>
</html>












